package com.woniuxy.feign;

import com.woniuxy.entity.AllUser;
import com.woniuxy.util.ResponseData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

/**
 * @Author hq
 * @Date 2025/7/15$ 10:27$
 * @Description TODO
 * @Params $
 * @Return $
 **/
@FeignClient(name = "campus-user")
public interface UserApi {
    /**
     * 获取用户信息
     * @param userId
     * @return
     */
    @GetMapping("/user/getUserInfoAPI/{userId}")
    public AllUser getUserInfoAPI(@PathVariable("userId") Long userId);
    /**
     * 扣除用户余额
     * @param userId
     * @param amount
     */
    @PostMapping("/user/deductBalance/{userId}/{amount}")
    public ResponseData deductBalance(@PathVariable("userId") Long userId,
                                      @PathVariable("amount") BigDecimal amount) ;

    /**
     * 增加用户余额
     * @param sellerId
     * @param amount
     */
    @PostMapping("/user/increaseBalance/{sellerId}/{amount}")
    public ResponseData increaseBalance(@PathVariable("sellerId") Long sellerId,
                                        @PathVariable("amount") BigDecimal amount) ;
}
